/************************************************************
	File:		ParticleSystem.h
	Author:		Mitchel Mishiev
	Purpose:	CParticleSystem class loads up the particles of the Game
************************************************************/

#pragma once

#include <vector>
using namespace std;

#include "Emitter.h"
#include "Particle.h"

// Structure to store the emitter's data
struct EmitterData
{
	int mParticle;
	int x;
	int y;
	int width;
	int height;
	int maxLife;
	int minLife;
	int sVelocityX;
	int sVelocityY;
	int eVelocityX;
	int eVelocityY;
	int sRotation;
	int eRotation;
	int sScaleX;
	int eScaleX;
	int sScaleY;
	int eScaleY;
	int sColorAlpha;
	int eColorAlpha;
	int sColorRed;
	int eColorRed;
	int sColorGreen;
	int eColorGreen;
	int sColorBlue;
	int eColorBlue;

};

class CParticleSystem
{
private:
	//EmitterList
	vector< CEmitter*>	EmitterList;

	//Update Variables
	float updateLife;
	float updateRed;
	float updateBlue;
	float updateGreen;
	float updateX;
	float updateY;

	//Particle
	CParticle* part;


public:
	CParticleSystem(void);
	~CParticleSystem(void);

	//Accessor
	vector< CEmitter*>	GetEmitterList() { return EmitterList; }

	//Mutator
	void SetEmitterList( CEmitter* item ) { EmitterList.push_back( item ); }

	void Update( float fElaspedTime );
	void Render();

	//Loads up the Emitters from an XML File and Setup the Particle List
	bool LoadParticles( const char* filename );
	void SetupParticleList( CEmitter* emitter );

};

